package com.epro.dx.adapter;

import java.util.ArrayList;

import com.epro.dx.fragment.ProductDetaiDescriptionFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

public class ProductDetailDescriptionViewPagerAdapter extends
		FragmentPagerAdapter {

	private ArrayList<ProductDetaiDescriptionFragment> list;
	private ArrayList<String> tabs;

	public ProductDetailDescriptionViewPagerAdapter(FragmentManager fm,ArrayList<ProductDetaiDescriptionFragment> list,
			ArrayList<String> tabs) {
		super(fm);
		this.list = list;
		this.tabs = tabs;
	}

	@Override
	public Fragment getItem(int position) {
		return list.get(position);
	}

	@Override
	public int getCount() {
		if(null!=list){
			return list.size();
		}
		return 0;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		if(null!=tabs && tabs.size()>position){
			return tabs.get(position);
		}
		return super.getPageTitle(position);
	}
}
